<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      :class="{
        content3: !props.info.value && !props.info.remarks && props.info.subTitle,
        content2: !props.info.value && !props.info.remarks && !props.info.subTitle,
      }"
      class="content outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style12/Level1outlineStyle3Bg.webp'})`,
      }"
    >
      <div
        class="Showroom-parent"
        :class="{ 'Showroom-parent1': route.meta.loopType }"
        v-if="props.info.digitalShowroom"
      >
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div
        class="title-box"
        :class="{ 'title-box-2': props.info.text.length > 9 }"
        :style="{
          backgroundImage:
            props.info.text.length > 8
              ? `url(${publicUrls + 'free/style12/Level1outlineStyle3Bgtitle2.webp'})`
              : `url(${publicUrls + 'free/style12/Level1outlineStyle3Bgtitle1.webp'})`,
        }"
      >
        <p>{{ props.info.text }}</p>
      </div>
      <div class="right-box">
        <p class="subtitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
        <div
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style12/Level1outlineStyle3Bgimg1.webp'})`,
          }"
          class="img-box"
          :class="{
            'img-box1': props.info.remarks && !props.info.subTitle,
            'img-box2': !props.info.remarks && props.info.subTitle,
            'img-box3': !props.info.remarks && !props.info.subTitle,
          }"
          v-if="props.info.value"
        >
          <div class="outline-cover">
            <img
              @click="ImgVisible = true"
              :src="urls + props.info.value + '?imageView2/3/w/1000/format/webp'"
              alt=""
            />
          </div>
        </div>

        <div class="remarks1" v-if="props.info.value">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="5"
          ></TextMax>
        </div>
        <div
          class="remarks2"
          :class="{
            remarks3: !props.info.subTitle,
          }"
          v-else-if="props.info.remarks"
        >
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="
              !props.info.subTitle ? getRemarksNum(13, route.meta.loopType) : getRemarksNum(13, route.meta.loopType)
            "
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free12Style3',
});
</script> 
    
<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style12.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax12.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
  indexs: {
    type: Number || String,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 40px;
  // margin-left: 120px;
  margin-top: 0;
  padding-left: 44px;
}
.content {
  display: flex;

  width: 748px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.Showroom-parent {
  display: flex;
  position: absolute;
  top: 30px;
  left: calc(76px + 62px);
  z-index: 15;
  width: 54px;
  height: 51px;
}

.img-box {
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 400px;
  height: 250px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 8px 1px 1px 8px;
  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;

    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.2);
    }
  }
}
.img-box1 {
}
.img-box2 {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 400px;
  height: 411px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 8px 1px 1px 8px;
}
.img-box3 {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 400px;
  height: 411px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 8px 1px 1px 8px;
}
.title-box {
  display: flex;
  flex-direction: column;
  // justify-content: center;

  width: 106px;
  height: 413px;
  margin-top: 29px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-left: -44px;
  padding: 61px 51px 0px 27px;
  padding-right: 0;
  :deep(p) {
    display: flex;
    flex-direction: column;
    width: 32px;
    // height: 100%;
    height: 272px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
    font-family: Alimama DongFangDaKai;
    font-size: 32px;
    font-weight: 400;
    line-height: 34px;
    text-align: center;
    background: linear-gradient(90deg, #ffeabc 0%, #fec64b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.title-box-2 {
  display: flex;

  width: 106px;
  height: 678px;
  margin-top: 29px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-left: -44px;
  padding: 61px 52px 0 26px;
  padding-right: 0px;
  :deep(p) {
    height: 544px;
  }
}
.right-box {
  display: flex;
  flex-direction: column;
  width: 400px;
  margin-top: 200px;
  margin-left: 9px;
}
.subtitle {
  width: 400px;
  font-family: PingFang SC;
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
  color: rgba(255, 227, 162, 1);
}

.remarks1 {
  width: 400px;
  margin-top: 20px;
}
.remarks2 {
  width: 400px;
  margin-top: 30px;
}
.remarks3 {
  width: 400px;
  margin-top: 30px;
}
.content2 {
  align-items: center;
  .title-box {
    margin-left: 209px;
    margin-top: 0px;
  }
}
.content3 {
  .subtitle {
    margin-top: 222px;
  }
}
</style>
